package cn.net.yugu.doraemon.api.common.enums;

import java.util.Optional;

import lombok.Getter;

/**
 * 删除状态
 *
 * @author xiangzhurui
 * @version 2022/11/18 22:40:13
 */
@Getter
public enum Deleted implements IntegerEnum {
    TRUE(1, "是", "已删除"),
    FALSE(0, "否", "未删除");
    private final Integer code;
    private final String desc;

    private final String phrase;

    Deleted(Integer code, String desc, String phrase) {
        this.code = code;
        this.desc = desc;
        this.phrase = phrase;
    }

    public static Optional<Deleted> of(Integer code) {
        return BaseEnum.of(values(), code);
    }
}
